/**
 * ======================================
 * 辖区管理列表
 * author: SKY-D
 * file: jurisdiction-class.js
 * date: 2022/6/12 14:16
 * ======================================
 */
import baseClass from '@/list/baseClass'
import { getSex, getBirth } from '@/utils/common'
import _ from 'lodash'
export default class floatingClass extends baseClass {
  constructor(prop) {
    super(prop)
    this.id = _.get(prop, 'id', '')
    this.index = _.get(prop, 'id', '')
    this.mobile = _.get(prop, 'mobile', '')
    this.realName = _.get(prop, 'real_name', '')
    this.age = _.get(prop, 'age', '')
    this.idCard = _.get(prop, 'id_card', '')
    this.sex = _.get(prop, 'sex', '')
    this.isAttract = _.get(prop, 'is_attract', '')
    this.employment = _.get(prop, 'employment', '')
    this.company = _.get(prop, 'company', {})
    this.companyName = _.get(prop, 'company.name', '')
    this.companyJob = _.get(prop, 'company_job', '')
    this.jobTime = _.get(prop, 'job_time', '')
    this.sex = getSex(_.get(prop, 'id_card', ''))
    this.age = getBirth(_.get(prop, 'id_card', ''))
    this.liveProvince = _.get(prop, 'live_province_name', '')
    this.liveCity = _.get(prop, 'live_city_name', '')
    this.liveArea = _.get(prop, 'live_area_name', '')
    this.liveStreet = _.get(prop, 'live_street_name', '')
    this.liveAddress = _.get(prop, 'live_address', '')
    this.liveAll = this.liveProvince + '/' + this.liveCity + '/' + this.liveArea + '/' + this.liveStreet + '/' + this.liveAddress
  }
  list() {
    return [
      {
        name: '序号',
        key: 'index',
        fixed: '',
        edit: false,
        show: true,
        value: ''
      },
      {
        name: '姓名',
        key: 'realName',
        fixed: '',
        edit: false,
        show: true,
        value: ''
      },
      {
        name: '手机号',
        key: 'mobile',
        fixed: '',
        edit: false,
        show: true,
        value: ''
      },
      {
        name: '出生日期',
        key: 'age',
        fixed: '',
        edit: false,
        show: true,
        value: ''
      },
      {
        name: '身份证',
        key: 'idCard',
        fixed: '',
        edit: false,
        show: true,
        value: ''
      },
      {
        name: '性别',
        key: 'sex',
        fixed: '',
        edit: false,
        show: true,
        value: ''
      },

      {
        name: '公司名称',
        key: 'companyName',
        fixed: '',
        edit: false,
        show: true,
        value: ''
      },

      {
        name: '现居地址',
        key: 'liveAll',
        fixed: '',
        edit: false,
        show: true,
        value: ''
      },

      {
        name: '操作',
        key: 'action',
        fixed: 'right',
        edit: false,
        show: true,
        value: 150
      }
    ]
  }
}
